<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
	<%@ include file="/WEB-INF/pages/weixin/include/title.jsp"%>
    <%@ include file="/WEB-INF/pages/weixin/include/include.jsp"%>
    
    <script type="text/javascript">
	    $(function(){
	    	
	    	$('.weui-navbar__item').on('click', function () {
	            $(this).addClass('weui-bar__item_on').siblings('.weui-bar__item_on').removeClass('weui-bar__item_on');
	        });
	    	
	    	renderer();
	    	wxUtils.initSearchBar();
	    	wxUtils.iniScrollBar();
	    });
	    
	    function renderer(id){
	    	$("#moreBtn").attr("pageNo",0);
	    	$("#moreBtn").attr("pageCount",1);
	    	var pageList = $("div.pageList");
			pageList.empty();
	    	wxUtils.loadDataPage({
	    		urlFun:function(pageNo){
	    			return JSON.stringify({"id": id,"title": "","pageNo": pageNo,"method":'channel_news'});
	    		},
	    		showFun:function(data){
	    			if(data){
		    			$.each(data.datalist,function(index,info){
		    				pageList.append(wxUtils.getItemHtml(0,{
		    					url:'wxUtils.load(\'/weixin/notice/content.do?id='+info['id']+'\')',
		    	    			id:info['id'],
		    	    			title:wxUtils.titleFormat(info['NEWSTITLE']),
		    	    			desc:wxUtils.titleFormat(info['NEWSCLASSIFYDIGEST'])
		    				}));
						});
	    			}else{
	    				wxUtils.closeToast();
	    				wxUtils.alert("加载数据失败，请刷新页面");
	    			}
	    		}
	    	});
	    }
	</script>
</head>
<body>
<div class="page" style="height: 100%;">
    <div class="page__bd">
    	<div class="weui-tab__panel detail_panel" style="display: none;"></div>
        <div class="weui-tab list_panel">
        	<div class="weui-navbar" position="top">
                <div class="weui-navbar__item weui-bar__item_on" onclick="renderer()">最新</div>
                <div class="weui-navbar__item" onclick="renderer(37)">公告</div>
                <div class="weui-navbar__item" onclick="renderer(39)">申报</div>
                <div class="weui-navbar__item" onclick="renderer(40)"> 政策培训</div>
            </div>
            <div class="weui-tab__panel">
            	<div class="weui-panel weui-panel_access" position="center">
				    <div class="weui-panel__bd pageList"></div>
				    <div class="weui-panel__ft">
					       <a href="javascript:void(0);" class="weui-cell weui-cell_access weui-cell_link" style="display: none;">
					           <div class="weui-cell__bd" id="moreBtn" pageNo="0" pageCount="1">查看更多</div>
					           <span class="weui-cell__ft"></span>
					       </a>
					</div>
				</div>
            </div>
        </div>
    </div>
	<jsp:include page="/WEB-INF/pages/weixin/bottom.jsp?menu=3"></jsp:include>
</div>
</body>
</html>

